home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 January / EnterCD 0105.iso / Internet / Norton Internet Security 2005 / NIS_Retail.EXE / Setup / PControl / APP / pcwiz.dll / HTML / WIZ-CREATEACCOUNTS.JS < prev    next >
Encoding:
JavaScript  |  2004-08-31  |  8.8 KB  |  242 lines

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    wiz-CreateAccounts (Javascript file for wiz-CreateAccounts.HTM)
  6. //
  7. // Copyright (c) by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11.  
  12.  
  13. function OnLoad()
  14. {
  15.     // Disable NextButton so user cannot constantly click next.
  16.     window.parent.frames("bottom").NextB.disabled = true;
  17.         
  18.     AccountName1.focus();
  19.     window.NISTitleName1.innerText = WrapNisum.ProductName;
  20.  
  21.     // Set NIS Pro Specific Text
  22.     var sProductType = WrapNisum.ProductType ;
  23.  
  24.     if(sProductType == "PT_PRO")
  25.     {
  26.         window.ParentalProductivityTitle1.innerText = StrID("ParentalControl_Title_NISPRO");
  27.  
  28.         // Adjust the drop down menus..
  29.         // Note: Remove unwanted items *before* replacing text
  30.         // of remaining items. Otherwise dropdowns get corrupted
  31.         // on Win2K + IE 5.0 (defect #404527)
  32.         select1.removeChild(window.IDS_CREATEACCOUNTEXT4);      // Remove the teenager option
  33.         window.IDS_CREATEACCOUNTEXT3.innerText = StrID("ParentalProductivityRestricted_NISPRO_Caps");
  34.         window.IDS_CREATEACCOUNTEXT5.innerText = StrID("ParentalProductivityStandard_NISPRO_Caps");
  35.  
  36.         select2.removeChild(window.IDS_CREATEACCOUNTEXT8);      // Remove the teenager option
  37.         window.IDS_CREATEACCOUNTEXT7.innerText = StrID("ParentalProductivityRestricted_NISPRO_Caps");
  38.         window.IDS_CREATEACCOUNTEXT9.innerText = StrID("ParentalProductivityStandard_NISPRO_Caps");
  39.  
  40.         select3.removeChild(window.IDS_CREATEACCOUNTEXT12);     // Remove the teenager option
  41.         window.IDS_CREATEACCOUNTEXT11.innerText = StrID("ParentalProductivityRestricted_NISPRO_Caps");
  42.         window.IDS_CREATEACCOUNTEXT13.innerText = StrID("ParentalProductivityStandard_NISPRO_Caps");
  43.  
  44.  
  45.         select4.removeChild(window.IDS_CREATEACCOUNTEXT16);     // Remove the teenager option
  46.         window.IDS_CREATEACCOUNTEXT15.innerText = StrID("ParentalProductivityRestricted_NISPRO_Caps");
  47.         window.IDS_CREATEACCOUNTEXT17.innerText = StrID("ParentalProductivityStandard_NISPRO_Caps");
  48. /*
  49.         select5.removeChild(window.IDS_CREATEACCOUNTEXT20);     // Remove the teenager option
  50.         window.IDS_CREATEACCOUNTEXT19.innerText = StrID("ParentalProductivityRestricted_NISPRO_Caps");
  51.         window.IDS_CREATEACCOUNTEXT21.innerText = StrID("ParentalProductivityStandard_NISPRO_Caps");
  52. */
  53.  
  54.         // End of adjusting drop down menus
  55.         window.ParentalProductivityRestricted8.innerText = StrID("ParentalProductivityRestricted_NISPRO_Caps");
  56.         window.ParentalProductivityStandard8.innerText = StrID("ParentalProductivityStandard_NISPRO_Caps");
  57.  
  58.         window.ParentalProductivityNumber.innerText = StrID("ParentalProductivity_Number");
  59.  
  60.         ID_WIZ_CREATEACCOUNTS_TD6.style.display = "none";
  61.         ID_WIZ_CREATEACCOUNTS_TD7.style.display = "none";
  62.         IDS_NISTIP.style.display = "none";
  63.     }
  64.     else
  65.     {
  66.         // Must modify the text string for NON Pro since we changed the default to NISPro text
  67.         // This was done so we have the "longer strings" by default and thus the drop down combo box can fit the longer strings
  68.  
  69.         // Adjust the drop down menus..
  70.         window.IDS_CREATEACCOUNTEXT3.innerText = StrID("ParentalProductivityRestricted_NIS_Caps");
  71.         window.IDS_CREATEACCOUNTEXT5.innerText = StrID("ParentalProductivityStandard_NIS_Caps");
  72.  
  73.         window.IDS_CREATEACCOUNTEXT7.innerText = StrID("ParentalProductivityRestricted_NIS_Caps");
  74.         window.IDS_CREATEACCOUNTEXT9.innerText = StrID("ParentalProductivityStandard_NIS_Caps");
  75.  
  76.         window.IDS_CREATEACCOUNTEXT11.innerText = StrID("ParentalProductivityRestricted_NIS_Caps");
  77.         window.IDS_CREATEACCOUNTEXT13.innerText = StrID("ParentalProductivityStandard_NIS_Caps");
  78.  
  79.  
  80.         window.IDS_CREATEACCOUNTEXT15.innerText = StrID("ParentalProductivityRestricted_NIS_Caps");
  81.         window.IDS_CREATEACCOUNTEXT17.innerText = StrID("ParentalProductivityStandard_NIS_Caps");
  82. /*
  83.         window.IDS_CREATEACCOUNTEXT19.innerText = StrID("ParentalProductivityRestricted_NIS_Caps");
  84.         window.IDS_CREATEACCOUNTEXT21.innerText = StrID("ParentalProductivityStandard_NIS_Caps");
  85. */
  86.     }
  87.     
  88.     // Enable NextButton
  89.     window.parent.frames("bottom").NextB.disabled = false;
  90. }
  91.  
  92. function Page_GoNext()
  93. {
  94.     try
  95.     {
  96.         // Disable NextButton
  97.         window.parent.frames("bottom").NextB.disabled = true;
  98.         
  99.     var iAccountIndex =  0;
  100.     // Verify Names
  101.  
  102.     if (AccountName1.value.length > 0)
  103.     {
  104.         // Fix Defect#361885, make sure account names entered are unique and not duplicated
  105.         if ((stricmp(AccountName1.value, AccountName2.value) == 0)
  106.         ||  (stricmp(AccountName1.value, AccountName3.value) == 0)
  107.         ||  (stricmp(AccountName1.value, AccountName4.value) == 0)
  108.             )
  109.         {
  110.             alert(StrID("ParentalProductivity_AccountNamesNotUnique"));
  111.                 window.parent.frames("bottom").NextB.disabled = false;
  112.             return false;
  113.         }
  114.  
  115.         // Fix Defect#362860.  Making sure that account name is valid, i.e. not already used and valid account name
  116.         var reason = 0;
  117.         var validName = parent.UserManager.VerifyUserName(AccountName1.value, true, null, reason);
  118.  
  119.         if(!validName)
  120.             {
  121.                 window.parent.frames("bottom").NextB.disabled = false;
  122.             return false;
  123.             }
  124.         parent.window.SetAccountInfo(iAccountIndex, AccountName1.value, null, select1.value);
  125.         iAccountIndex++;
  126.     }
  127.  
  128.     if (AccountName2.value.length > 0)
  129.     {
  130.  
  131.         if( (stricmp(AccountName2.value, AccountName1.value)==0)
  132.         ||  (stricmp(AccountName2.value, AccountName3.value)==0)
  133.         ||  (stricmp(AccountName2.value, AccountName4.value)==0)
  134.             )
  135.         {
  136.             alert(StrID("ParentalProductivity_AccountNamesNotUnique"));
  137.                 window.parent.frames("bottom").NextB.disabled = false;
  138.             return false;
  139.         }
  140.  
  141.         var reason = 0;
  142.         var validName = parent.UserManager.VerifyUserName(AccountName2.value, true, null, reason);
  143.  
  144.         if(!validName)
  145.             {
  146.                 window.parent.frames("bottom").NextB.disabled = false;
  147.             return false;
  148.             }
  149.         parent.window.SetAccountInfo(iAccountIndex, AccountName2.value, null, select2.value);
  150.         iAccountIndex++;
  151.     }
  152.  
  153.     if (AccountName3.value.length > 0)
  154.     {
  155.         if( (stricmp(AccountName3.value, AccountName1.value)==0)
  156.         ||  (stricmp(AccountName3.value, AccountName2.value)==0)
  157.         ||  (stricmp(AccountName3.value, AccountName4.value)==0)
  158.             )
  159.         {
  160.             alert(StrID("ParentalProductivity_AccountNamesNotUnique"));
  161.                 {
  162.                     window.parent.frames("bottom").NextB.disabled = false;
  163.             return false;
  164.         }
  165.             }
  166.  
  167.         var reason = 0;
  168.         var validName = parent.UserManager.VerifyUserName(AccountName3.value, true, null, reason);
  169.  
  170.         if(!validName)
  171.             {
  172.                 window.parent.frames("bottom").NextB.disabled = false;
  173.             return false;
  174.             }
  175.  
  176.         parent.window.SetAccountInfo(iAccountIndex, AccountName3.value, null, select3.value);
  177.         iAccountIndex++;
  178.     }
  179.  
  180.     if (AccountName4.value.length > 0)
  181.     {
  182.         if( (stricmp(AccountName4.value, AccountName1.value)==0) 
  183.         ||  (stricmp(AccountName4.value, AccountName2.value)==0) 
  184.         ||  (stricmp(AccountName4.value, AccountName3.value)==0) 
  185.             )
  186.         {
  187.             alert(StrID("ParentalProductivity_AccountNamesNotUnique"));
  188.                 window.parent.frames("bottom").NextB.disabled = false;
  189.             return false;
  190.         }
  191.  
  192.         var reason = 0;
  193.         var validName = parent.UserManager.VerifyUserName(AccountName4.value, true, null, reason);
  194.  
  195.         if(!validName)
  196.     {
  197.                 window.parent.frames("bottom").NextB.disabled = false;
  198.             return false;
  199.         }
  200.  
  201.             parent.window.SetAccountInfo(iAccountIndex, AccountName4.value, null, select4.value);
  202.         iAccountIndex++;
  203.     }
  204.  
  205.     // Tell parent window, how many accounts to set
  206.     parent.window.SetAccountNum(iAccountIndex);
  207.         window.parent.frames("bottom").NextB.disabled = false;
  208.     return true;
  209. }
  210.     catch(err)
  211.     {
  212.         window.parent.frames("bottom").NextB.disabled = false;
  213.     }
  214. }
  215.  
  216. function Page_GoBack()
  217. {
  218.     return true;
  219. }
  220.  
  221. function OnKeyDownHandler()
  222. {
  223.     // Last Control Tab over to the <back, next, close> button.
  224.     var VK_ESCAPE = 27;
  225.  
  226.     if (window.event.keyCode == VK_ESCAPE)
  227.     {
  228.         // Escape key.. We want to exit out of the wizard..
  229.         parent.window.navigate("res://closeme.xyz");
  230.     }
  231. }
  232.  
  233. function stricmp(szA, szB)
  234. {
  235.     if(szA.toUpperCase() < szB.toUpperCase())
  236.         return -1;
  237.     else if(szA.toUpperCase() > szB.toUpperCase())
  238.         return 1;
  239.  
  240.     return 0;
  241. }
  242.